# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>
# Contributor: Andre Klitzing <andre AT incubo DOT de>
# Contributor: max-k <max-k AT post DOT com>

pkgname=reprepro
pkgver=5.4.2
pkgrel=1
pkgdesc='Debian package repository producer'
url="https://salsa.debian.org/debian/reprepro"
arch=('loong64' 'x86_64')
license=('GPL2')
depends=('db5.3' 'gpgme' 'zlib' 'bzip2' 'xz' 'libarchive' 'libgpg-error')
source=("https://salsa.debian.org/debian/reprepro/-/archive/reprepro-${pkgver}/reprepro-reprepro-${pkgver}.tar.bz2"
        bdb_5.3.patch)
sha512sums=('663215f6b4acf0488d884a3e294f329d09201eeb9329a6463d18f77695bbb8aa25d070f220eb080fea126099198896a488798801f89783663091a0daf2ef3619'
            '1ef3788a73bcf9a56b58890632520bc612448fb4873a4feb9ece82fdb880223345384bd83d634b174d756392117ee5808de4c301dc639b3ae7539b5503f5ab3a')
b2sums=('9b5d7f5825519d85999e4719806247c9ac388fab2838ecba3f706866d6c67e65177379a51e1c12017f2334f76659fe58c671ced2b8eb2fd75f6d24bbc2b1406e'
        'be2bf6f0a198dd90d34a4976154970857463bca22d9df49e9f697586e60d4d577652f13cab4abf105681ad7a100522b29ce3f743ab98a696fe95348c308d782c')

prepare() {
  cd "${pkgname}-${pkgname}-${pkgver}"
  patch -Np1 -i ../bdb_5.3.patch
}

build() {
  cd "${pkgname}-${pkgname}-${pkgver}"
  set -x

  export CPPFLAGS="$CPPFLAGS -I/usr/include/db5.3"

  libtoolize --force
  aclocal
  autoheader
  automake --add-missing
  autoconf

  ./configure --prefix=/usr
  make
}

package() {
  cd "${pkgname}-${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
}

# vim: ts=2 sw=2 et:
